import React, { Component, useState } from "react";
import Tow from "./tow"
import Three from "./three";
// export default class One extends Component {
//     state = {
//         num: 0
//     }
//     getgive = () => {
//         this.setState()
//     }
//     render() {
//         return (
//             <div>
//                 <h1>one组件</h1>
//                 <hr />
//                 <Tow num={this.state.num}></Tow>
//                 <hr />
//                 <Three></Three>
//             </div>
//         )
//     }
// }
export default function One() {
    let [money, setmoney] = useState(500);
    let [xixi, setxixi] = useState("xixi");
    function getTow(val) {
        setmoney(money + val)
    }
    function getThree(val) {
        setxixi(xixi = val)
    }
    return (
        <div>
            <h1>RMB:{money}</h1>
            <h1>xixi:{xixi}</h1>
            <hr></hr>
            <Tow getTow={getTow}></Tow>
            <hr></hr>
            <Three getThree={getThree}></Three>
        </div>
    )
}